Repository navigation
drm/vc4: Fix out of order frames during asynchronous page flips - #4925
Conversation
|
Did you push the wrong patch? That looks like a direct cherry-pick of f694d1c. |
|
It can wait until next week, though. |
|
Agreed - this doesn't build on 5.15 due to dma fence api changes. |
When doing an asynchronous page flip (PAGE_FLIP ioctl with the DRM_MODE_PAGE_FLIP_ASYNC flag set), the current code waits for the possible GPU buffer being rendered through a call to vc4_queue_seqno_cb(). On the BCM2835-37, the GPU driver is part of the vc4 driver and that function is defined in vc4_gem.c to wait for the buffer to be rendered, and once it's done, call a callback. However, on the BCM2711 used on the RaspberryPi4, the GPU driver is separate (v3d) and that function won't do anything. This was working because we were going into a path, due to uninitialized variables, that was always scheduling the callback. However, we were never actually waiting for the buffer to be rendered which was resulting in frames being displayed out of order. The generic API to signal those kind of completion in the kernel are the DMA fences, and fortunately the v3d drivers supports them and signal when its job is done. That API also provides an equivalent function that allows to have a callback being executed when the fence is signalled as done. Let's change our driver a bit to rely on the previous function for the older SoCs, and on DMA fences for the BCM2711. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
b8ad842 to
a81cb73
Compare
No, I forgot to commit the changes I had locally... It should be ok now, sorry |
|
This compiles now and kodi still runs. I don't have a test app that shows the out-of-order issue (but if it worked on 5.10 the odds seem good). |
Just tested this patch applied to rpi-5.16.y and it fixes the vsync issue with Quake3e and another OpenGL app I saw this issue with. Thanks for the fix. Closed #4901. |
kernel: ARM: dts: bcm2711-rpi-ds: Disable the BCM2835 STC See: #1702 kernel: KMS Writeback Fixes See: raspberrypi/linux#4924 kernel: staging: vc04_services: codec: Add support for V4L2_PIX_FMT_RGBA32 format See: raspberrypi/linux#4931 kernel: drm/vc4: Fix out of order frames during asynchronous page flips See: raspberrypi/linux#4925
kernel: ARM: dts: bcm2711-rpi-ds: Disable the BCM2835 STC See: raspberrypi/firmware#1702 kernel: KMS Writeback Fixes See: raspberrypi/linux#4924 kernel: staging: vc04_services: codec: Add support for V4L2_PIX_FMT_RGBA32 format See: raspberrypi/linux#4931 kernel: drm/vc4: Fix out of order frames during asynchronous page flips See: raspberrypi/linux#4925
This a port of the PR #4571 for 5.15, with the updated function name that was broken before.